<?php echo $javascript->link('gears_init');?>
<?php echo $javascript->link('map');?>
<?php
  $twitterLat = $datahash['status']['Location']['lat'];
  $twitterLng = $datahash['status']['Location']['lng'];
  $twitterImg = "'" . $datahash['twitter_user']->profile_image_url . "'";
  $twitterTweet = "'" . $datahash['status']['Status']['text'] . "'";
  
?>

<script type="text/javascript">
	var WEB_ROOT  = '<?php echo  FULL_BASE_URL.$this->webroot; ?>';//ルートディレクトリ
	var myInfo = new Array();
	myInfo[0] = <?php echo $twitterLat;?>;
	myInfo[1] = <?php echo $twitterLng;?>;
	myInfo[2] = <?php echo $twitterImg;?>;
	myInfo[3] = <?php echo $twitterTweet; ?>;
	//console.log(myInfo);
	//var neighborInfo = new Array();
	var i = 0;
	var neighborInfo = new Array();
	<?php
	foreach($neighbors as $key => $val){ ?>
		neighborInfo[i] = new Array();
		neighborInfo[i][0] = <? echo $val['Location']['lat']; ?>;
		neighborInfo[i][1] = <? echo $val['Location']['lng']; ?>;
		neighborInfo[i][2] = <? echo '"' . $val['Status']['text'] . '"'; ?>;
		//window.alert(neighborInfo[i][0]);
		i++;
<?	}	?>
	i = 0;
<?	foreach($neighborsTwitterInfo as $key => $val){ ?>
		neighborInfo[i][3] = <? echo '"' . $val->profile_image_url . '"'; ?>;
		//console.log(neighborInfo[i][3]);
		i++;
<?	} 	?>	
	//console.log(neighborInfo);
</script>

<!--<body onload="displayMap(<?php echo $twitterLat . ',' . $twitterLng . ',' . $twitterImg; ?>);">-->
<body onload="displayManyTweets(myInfo,neighborInfo);">
<!--<body onload="displayMy(myInfo);">-->
  <h2>地図表示</h2>
  <div id="now_location">地図の中心[,]</div>
  <div id="map_canvas" style="width:100%; height:400px;"></div>
  <input type="button" value="test" onclick="hoge();">
</body>